import request from '@/utils/request'


export function findListByPage(param) {
  return request({
    url: 'api/scriptPack/task/page',
    method: 'get',
    param
  })
}

export function findById(id) {
  return request({
    url: 'api/scriptPack/task' + '/' + id,
    method: 'get',
    id
  })
}

export function add(data) {
  return request({
    url: 'api/scriptPack/task',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: 'api/scriptPack/task',
    method: 'put',
    data
  })
}

export function del(id) {
  return request({
    url: 'api/scriptPack/task'  + '/' + id,
    method: 'delete',
    id
  })
}

export function upload(data) {
  return request({
    url: 'api/scriptPack/task/upload',
    data: data,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data;boundary=' + new Date().getTime()
    }
  })
}

export function pack(data) {
  return request({
    url: 'api/scriptPack/task/pack',
    method: 'post',
    data
  })
}

export function getBranch(params) {
  return request({
    url: 'api/scriptPack/task/branch',
    method: 'get',
    params
  })
}

export default {
  findListByPage,
  findById,
  add,
  edit,
  del,
  upload,
  pack,
  getBranch
}
